<template>
    <div class="main_box" style="padding:10px">
      <div class="add_wrap">
        <el-form label-width="200px" v-if="dataInfo">
          <div class="tit">
            <h2>基础信息</h2>
            <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回</el-button>
          </div>
          <el-row>
            <el-form-item label="部门名称:">
              <span>{{ dataInfo.departName }}</span>
            </el-form-item>
            <el-form-item label="所属商户:">
              <span>{{ dataInfo.businessName }}</span>
            </el-form-item>
            <el-form-item label="等级:">
              <span>{{ formatLevels(dataInfo.levels) }}</span>
            </el-form-item>
            <el-form-item label="上级部门:">
                <span>{{ dataInfo.parentDepartName||"无" }}</span>
            </el-form-item>
            <el-form-item label="备注:">
              <span>{{ dataInfo.remark }}</span>
            </el-form-item>
            <el-form-item label="创建人:">
              <span>{{ dataInfo.createUserName }}</span>
            </el-form-item>
            <el-form-item label="创建时间:">
              <span>{{ dataInfo.createDate }}</span>
            </el-form-item>
            <el-form-item label="修改人:">
              <span>{{ dataInfo.modifyUserName }}</span>
            </el-form-item>
            <el-form-item label="修改时间:">
              <span>{{ dataInfo.modifyDate }}</span>
            </el-form-item>
            <el-form-item label="火警通知内容:">
              <span>{{ dataInfo.fireContent }}</span>
            </el-form-item>
          </el-row>
        </el-form>
      </div>
    </div>
  </template>

    <script>
    import BusinessDepartApi from "@/api/business/depart";
    export default{
        data(){
            return {
              dataInfo: {},
              departNames:""
            }
        },
        mounted(){
          this.init();
        },
        methods:{
          init(){
            this.getData();
          },
          getData(){
            BusinessDepartApi.getBusinessDepartInfo({id:this.$route.query.id}).then(res=>{
                this.dataInfo = res.data
            })
          },
          /**
           * 过滤器
           */
          formatLevels(value){
            if(value == 0){
              return "商户";
            }else if(value== 1){
              return "部门";
            }else if(value== 2){
              return "组";
            }else if(value==3){
              return "岗位"
            }
          },
          returnList(){
            this.$store.dispatch('delView', this.$route);
            this.$router.push({path: "/business/businessDepartManagement"})
          }
        },
    }
    </script>
<style lang="scss" scoped>
@import "@/assets/css/views/add.scss";
</style>
<style lang="scss">
@import "@/assets/css/views/content.scss";
</style>
